 * CREATING REPLICATION DATA
 
 cd ("Directory with the replication data here")
 
    use "Green_et_al_POBE_replication_survey_raw.dta", clear

 recode profile_ethnicity (1=1) (nonmis=2), gen(minority)
 la def minority 1 "White British" 2 "Ethnic minority", modify
 la val minority minority
 la var minority "Ethnic minority"

 gen declineScaleW12 = localEcon1520YrW12 - localEconNowW12 if localEcon1520YrW12!=9999 & localEconNowW12!=9999

 recode profile_gross_householdW12 (1/3=1) (4/5=2) (6/7=3) (8/10=4) (11/15=5) (17=6) (9999=7), gen(ghincomeW12)
tab ghincomeW12
label define ghincomelab 1 "under 15k" 2 "15-25k" 3 "25-35k" 4 "35-50k" 5 "50k+" 6 "prefer not to answer" 7 "DK"
label values ghincomeW12 ghincomelab

recode profile_house_tenureW12 (1/3=1) (3/6=2) (7/9=3), gen(homeownerW12)
recode homeownerW12 (2/3=2), gen(homeowner_bin_W12)
la def homeowner_bin 1 "owner (outright or mortgage)" 2 "non-owner", modify
la val homeowner_bin_W12 homeowner_bin

recode econPersonalRetroW11 (3=0) (1/2=1) (4/5=3) (9999=4), gen(econPersonalRetro_4xW11)
la def econPersonalRetro4x 0 "Finances: same" 1 "Finances: worse" 3 "Finances: better" 4 "Finances: DK", modify
la val econPersonalRetro_4xW11 econPersonalRetro_4x
  
  egen euRefVoteRetroW12 = group(euRefTurnoutRetroW12 euRefpastVoteW12)
replace euRefVoteRetroW12 = 3 if euRefTurnoutRetroW12==0 | euRefTurnoutRetroW12==9999
tab euRefVoteRetroW12
la def euRefVoteRetroW12_lab 1 "Voted Remain" 2 "Voted Leave" 3 "No vote/DK turnout/DK vote", modify
la val euRefVoteRetroW12 euRefVoteRetroW12_lab

gen infoScale = infoSourceTVW12 + infoSourcePaperW12 + infoSourceRadioW12 + infoSourceInternetW12
drop if infoScale>20
replace infoScale = infoScale/4
rename infoScale infoScaleW12
label variable infoScaleW12 "Mean use of info sources W12"

recode localEconNowW12 (1/5=1) (nonmis=0), gen(localEconNowYN_W12)
recode localEcon1520YrW12 (1/5=1) (nonmis=0), gen(localEcon1520YN_W12)

gen answersboth_W12 = 1 if localEconNowYN_W12 ==1 & localEcon1520YN_W12 == 1
replace answersboth_W12 = 0 if (localEconNowYN_W12==0 | localEcon1520YN_W12==0)

recode ageCatW12 (6/7=0), gen(ageCatW12_v2)
la def ageCatW12_v2 0 "Age: 65+" 1 "16-24" 2 "25-34" 3 "35-44" 4 "45-54" 5 "55-64"
la val ageCatW12_v2 ageCatW12_v2

gen LAD_change_W10_W12 = 1 if LAD17CD_W12!=LAD17CD_W10
replace LAD_change_W10_W12 = 0 if LAD17CD_W12==LAD17CD_W10
replace LAD_change_W10_W12 = . if (LAD17CD_W12=="" |LAD17CD_W10=="")
la def LAD_change_W10_W12 1 "Moved to LAD recently"
la val LAD_change_W10_W12 LAD_change_W10_W12

gen msoa_change_W10_W12 = 1 if msoa11W12!=msoa11W10
replace msoa_change_W10_W12 = 0 if msoa11W12==msoa11W10
replace msoa_change_W10_W12 = . if (msoa11W12=="" |msoa11W10=="")
la def msoa_change_W10_W12 1 "Moved to MSOA recently"
la val msoa_change_W10_W12 msoa_change_W10_W12

recode workingStatusW6_W12 (1/4=1) (5/9=2), gen(workStat_lab_mkt)
la def workStat_lab_mkt 1 "In labour market" 2 "Out of labour market", modify
la val workStat_lab_mkt workStat_lab_mkt

recode partyIdW12 (2=0) (9999=10) (1=1) (nonmis=9), gen(pid_comb_4x_W12)
la def pid_comb 0 "PID: Labour" 1 "PID: Cons" 9 "PID: Other" 10 "PID: None"
la val pid_comb_4x_W12 pid_comb

recode econGenRetroW11 (3=0) (1/2=1) (4/5=3) (9999=4), gen(econGenRetro_4xW11)
la def econGenRetro4x 0 "Nat econ: same" 1 "Nat econ: worse" 3 "Nat econ: better" 4 "Nat econ: DK", modify
la val econGenRetro_4xW11 econGenRetro4x

 save "Green_et_al_POBE_replication_survey.dta", replace

use "Green_et_al_POBE_replication_context_raw_LAD.dta", clear

gen unemp_inc_Y13_new = unemp_2017_new - unemp_2004_new
gen hp_inc_y15_new = ((house_price_17_new - house_price_02_new)/house_price_02_new)*100
gen ghdi_inc_y15_new = ((ghdi_2017_new - ghdi_2002_new)/ghdi_2002_new)*100

egen z_unemp_inc_Y13_new = std(unemp_inc_Y13_new)
egen z_hp_dec_y15_new = std(hp_inc_y15_new)
replace  z_hp_dec_y15_new = z_hp_dec_y15_new*-1
egen z_ghdi_dec_y15_new = std(ghdi_inc_y15_new)
replace  z_ghdi_dec_y15_new = z_ghdi_dec_y15_new *-1

* CAN PUT THIS INTO MODEL BUILDER TO GET FIGURE A1
sem (Latent_decline_2002_17 -> z_hp_dec_y15_new, ) (Latent_decline_2002_17 -> z_ghdi_dec_y15_new, ) (Latent_decline_2002_17 -> z_unemp_inc_Y13_new, ), latent(Latent_decline_2002_17 ) nocapslatent
predict dec_latent_Y15_closest_unemp_new, latent 
replace dec_latent_Y15_closest_unemp_new = . if (z_hp_dec_y15_new==. | z_ghdi_dec_y15_new==. | z_unemp_inc_Y13_new == .)
egen z_dec_LY15_closest_unemp_new = std(dec_latent_Y15_closest_unemp_new)

egen z_unemp_2017_new = std(unemp_2017_new)
egen z_house_price_17_new = std(house_price_17_new)
egen z_ghdi_2017_new = std(ghdi_2017_new)

replace z_house_price_17_new = z_house_price_17_new * -1
replace z_ghdi_2017_new = z_ghdi_2017_new * -1

sem (z_unemp_2017_new z_house_price_17_new z_ghdi_2017_new <- latent_2017), latent(latent_2017) nocapslatent
predict latent_2017_with_unemp_new if z_unemp_2017_new!=. & z_house_price_17_new!=. & z_ghdi_2017_new!=., latent
egen z_latent_2017_unemp_dec = std(latent_2017_with_unemp_new)
sum z_latent_2017_unemp_dec

 save "Green_et_al_POBE_replication_context_latent_LAD.dta", replace
 
 use "Green_et_al_POBE_replication_context_raw_MSOA.dta", clear 
  
 gen pct_claim_change_04_17= pct_claim_17 - pct_jsa_04
 gen pct_change_02_17 = ((price_Jun_17-price_Jun_02)/price_Jun_02)*100
 
 egen z_pricechange_02_17_msoa = std(pct_change_02_17)
egen z_price_17_msoa = std(price_Jun_17)
egen z_unempchange_04_17_msoa = std(pct_claim_change_04_17)
egen z_unemp_17_msoa = std(pct_claim_17)

sem (z_unempchange_04_17_msoa z_pricechange_02_17_msoa  <- L1)
predict latent_decline_msoa if z_unempchange_04_17_msoa!=. & z_pricechange_02_17_msoa!=., latent
egen z_latent_decline_msoa = std(latent_decline_msoa)

sem (z_unemp_17_msoa z_price_17_msoa <- L2)
predict latent_distress_msoa if z_unemp_17_msoa!=. & z_price_17_msoa!=., latent
egen z_latent_distress_msoa = std(latent_distress_msoa)

keep msoa11 z_latent_distress_msoa z_latent_decline_msoa

save "Green_et_al_POBE_replication_context_latent_MSOA.dta", replace

 use "Green_et_al_POBE_replication_survey.dta", clear
 
 merge m:1 LAD17CD_W12 using "Green_et_al_POBE_replication_context_latent_LAD.dta", gen(lad_merge)
 
 merge m:1 msoa11W12 using "Green_et_al_POBE_replication_context_latent_MSOA.dta", gen(msoa_merge)

 ren z_dec_LY15_closest_unemp_new latent_decline_LAD
 ren z_latent_2017_unemp_dec latent_distress_LAD
 ren unemp_inc_Y13_new incr_unemp_LAD
 ren unemp_2017_new unemp_LAD
 ren ghdi_inc_y15_new incr_income_LAD
 ren ghdi_2017_new ghdi_LAD
 ren hp_inc_y15_new incr_houseprice_LAD
 ren house_price_17_new houseprice_LAD
 ren z_latent_decline_msoa latent_decline_MSOA
 ren z_latent_distress_msoa latent_distress_MSOA
 
 la var latent_decline_LAD "Latent decline (LAD), 2002-2017"
    la var latent_distress_LAD "Latent economic distress (LAD), 2017"
    la var incr_unemp_LAD "p.p. increase unemployment 2004-2017 (LAD)"
    la var unemp_LAD "% unemployment 2017 (LAD)"
    la var incr_income_LAD "GHDI % increase 2002-2017 (LAD)"
    la var ghdi_LAD "Average GHDI 2017 (LAD)"
    la var incr_houseprice_LAD "% increase average house prices 2002-2017 (LAD)"
    la var houseprice_LAD "Average house prices 2017 (LAD)"

   
  * FIGURE 1
  
     melogit answersboth_W12 ib0.ageCatW12_v2 i.gender i.edlevelW12 i.minority i.caringResponsibilitiesW6_W14 i.LAD_change_W10_W12 ib2.workStat_lab_mkt  ///
  i.ghincomeW12 i.homeowner_bin_W12 ib0.econPersonalRetro_4xW11 ///
  ib0.pid_comb_4x_W12 i.euRefVoteRetroW12 ib0.econGenRetro_4xW11 c.changeImmigW11 c.polAttentionpdlW12 infoScaleW12 if _est_answers_model_pop==1 || LAD17CD_W12: 
  eststo answers_demog_polit_T1_NEW, refresh
  
    coefplot answers_demog_polit_T1_NEW, xline(0) mlabel(cond(@pval<.001, "***", cond(@pval<.01, "**", cond(@pval<.05, "*", "")))) baselevels drop(_cons 1.gender 1.minority 2.workStat_lab_mkt 1.homeowner_bin_W12 0.caringResponsibilitiesW6_W14 0.LAD_change_W10_W12) headings(0.ageCatW12_v2 = "{bf:Demographics}" 1.workStat_lab_mkt = "{bf:Economics}" 0.pid_comb_4x_W12 = "{bf:Politics}") title("Predictors: answers 'economy now' and 'economy then'", size(medlarge) margin(medsmall) span) scheme(s2mono) scale(0.6) xsize(6.27) ysize(6.27) graphregion(fcolor(white)) xtitle("Logistic regression coefficient", margin(small))
	  graph save decline_graph1_POLB_RR, replace
	  graph export decline_graph1_POLB_RR.tif
	  
  * FIGURE 2

  	                xtmixed declineScaleW12 ib0.ageCatW12_v2 i.gender i.edlevelW12 i.minority  i.caringResponsibilitiesW6_W14 i.LAD_change_W10_W12 ///
					ib2.workStat_lab_mkt  i.ghincomeW12 i.homeowner_bin_W12 ib0.econPersonalRetro_4xW11 ///
 ib0.pid_comb_4x_W12 i.euRefVoteRetroW12 ib0.econGenRetro_4xW11 c.changeImmigW11 c.polAttentionpdlW12 infoScaleW12  || LAD17CD_W12:   if model_pop==1
    mltrsq
   eststo decline_demog_polit_T2_NEW
   
        coefplot decline_demog_polit_T2_NEW, xline(0) mlabel(cond(@pval<.001, "***", cond(@pval<.01, "**", cond(@pval<.05, "*", "")))) baselevels drop(_cons 1.gender 1.minority 2.workStat_lab_mkt 1.homeowner_bin_W12 0.caringResponsibilitiesW6_W14 0.LAD_change_W10_W12) headings(0.ageCatW12_v2 = "{bf:Demographics}" 1.workStat_lab_mkt = "{bf:Economics}" 0.pid_comb_4x_W12 = "{bf:Politics}") title("Predictors: decline perceptions", size(medlarge) margin(medsmall) span) scheme(s2mono) scale(0.6) xsize(6.27) ysize(6.27) graphregion(fcolor(white)) xtitle("Regression coefficient", margin(small)) xla(-0.5(.25)0.5)
	  graph save decline_graph2_POLB_RR, replace
	  	  graph export decline_graph2_POLB_RR.tif

	  
	  * FIG 3
	  
	  	  	                xtmixed declineScaleW12 ib0.ageCatW12_v2 i.gender ib2.workStat_lab_mkt i.homeowner_bin_W12 ///
  i.ghincomeW12 i.caringResponsibilitiesW6_W14 i.edlevelW12 i.minority  i.LAD_change_W10_W12 ///
  c.polAttentionpdlW12 infoScaleW12  c.changeImmigW11 ib0.econPersonalRetro_4xW11 ib0.econGenRetro_4xW11 i.euRefVoteRetroW12 ib0.pid_comb_4x_W12 ///
   ib0.pid_comb_4x_W12##c.latent_decline_LAD c.latent_distress_LAD  || LAD17CD_W12:   if model_pop==1
  mltrsq
   eststo decline_int_T2_NEW

	     coefplot decline_demog_polit_T2_NEW decline_int_T2_NEW, xline(0) xsc(r(-.5 .5)) xlabel(-.5(.25).5) mlabel(cond(@pval<.001, "***", cond(@pval<.01, "**", cond(@pval<.05, "*", "")))) baselevels title("Regression coefficient") drop(_cons ) scheme(s2mono) keep(0.pid_comb_4x_W12 1.pid_comb_4x_W12 9.pid_comb_4x_W12 10.pid_comb_4x_W12 latent_decline_LAD 0.pid_comb_4x_W12#c.latent_decline_LAD 1.pid_comb_4x_W12#c.latent_decline_LAD 9.pid_comb_4x_W12#c.latent_decline_LAD 10.pid_comb_4x_W12#c.latent_decline_LAD) legend(off) scale(0.8)
      graph save decline_graph3_POLB_RR, replace
	  	  	  graph export decline_graph3_POLB_RR.tif
	  
	  * FIG 4 - with party colours
		  
		     	                xtmixed declineScaleW12 ib0.ageCatW12_v2 i.gender ib2.workStat_lab_mkt i.homeowner_bin_W12 ///
  i.ghincomeW12 i.caringResponsibilitiesW6_W14 i.edlevelW12 i.minority  i.LAD_change_W10_W12 ///
  c.polAttentionpdlW12 infoScaleW12 ib0.econGenRetro_4xW11 c.changeImmigW11 ib0.econPersonalRetro_4xW11 i.euRefVoteRetroW12 ib0.pid_comb_4x_W12 ///
   ib0.pid_comb_4x_W12##c.latent_decline_LAD c.latent_distress_LAD  || LAD17CD_W12:   if model_pop==1

    margins, at(latent_decline_LAD=(-1.8(.2)1.5) pid_comb_4x_W12=(0 1 9 10)) asobserved
		    marginsplot, plotdimension(pid_comb_4x_W12) xtitle("Latent decline (2002-2017)") ytitle("Perceived decline (-4 to +4)") legend(position(6) cols(2)) plot1opts(mcolor("228 0 59" ) lcolor("228 0 59")) ci1opts(lcolor("228 0 59")) plot2opts(mcolor("0 135 220") lcolor("0 135 220")) ci2opts(lcolor("0 135 220")) plot3opts(mcolor(gs8) lcolor(gs8)) ci3opts(lcolor(gs8)) plot4opts(mcolor(gs12) lcolor(gs12)) ci4opts(lcolor(gs12)) xlab(-1 0 1) xtick(-1.8(.2)1.4)
          graph save decline_graph4_POLB_RR, replace
		  		  	  	  graph export decline_graph4_POLB_RR.tif, replace

	  
	  * TABLE 2 
	  
	    	                xtmixed declineScaleW12 ib0.ageCatW12_v2 i.gender i.edlevelW12 i.minority  i.caringResponsibilitiesW6_W14 i.LAD_change_W10_W12 ///
					ib2.workStat_lab_mkt  i.ghincomeW12 i.homeowner_bin_W12 ib0.econPersonalRetro_4xW11 ///
  i.euRefVoteRetroW12 ib0.econGenRetro_4xW11 c.changeImmigW11 c.polAttentionpdlW12 infoScaleW12 ib0.pid_comb_4x_W12 c.latent_decline_LAD c.latent_distress_LAD  || LAD17CD_W12:   if model_pop==1
    mltrsq
   eststo decline_pid_context_noint

	  
	  	  	                xtmixed declineScaleW12 ib0.ageCatW12_v2 i.gender ib2.workStat_lab_mkt i.homeowner_bin_W12 ///
  i.ghincomeW12 i.caringResponsibilitiesW6_W14 i.edlevelW12 i.minority  i.LAD_change_W10_W12 ///
  c.polAttentionpdlW12 infoScaleW12  c.changeImmigW11 ib0.econPersonalRetro_4xW11 ib0.econGenRetro_4xW11 i.euRefVoteRetroW12 ib0.pid_comb_4x_W12 ///
   ib0.pid_comb_4x_W12##c.latent_decline_LAD c.latent_distress_LAD  || LAD17CD_W12:   if model_pop==1
  mltrsq
   eststo decline_pid_context_int
   
  
   esttab decline_pid_context_noint decline_pid_context_int using decline_T2_POLB_RR_alt.rtf, replace label not b(%9.2f) ci wide compress nocons nogaps drop(_cons 1.gender 1.minority 2.workStat_lab_mkt 1.homeowner_bin_W12 0.caringResponsibilitiesW6_W14 0.LAD_change_W10_W12) stats(N N_l2 sb_rsq_l1 sb_rsq_l2 aic bic) 
   
   	     coefplot decline_pid_context_noint decline_pid_context_int, xline(0) xsc(r(-.5 .5)) xlabel(-.5(.25).5) mlabel(cond(@pval<.001, "***", cond(@pval<.01, "**", cond(@pval<.05, "*", "")))) baselevels title("Regression coefficient") drop(_cons ) scheme(s2mono) keep(0.pid_comb_4x_W12 1.pid_comb_4x_W12 9.pid_comb_4x_W12 10.pid_comb_4x_W12 latent_decline_LAD 0.pid_comb_4x_W12#c.latent_decline_LAD 1.pid_comb_4x_W12#c.latent_decline_LAD 9.pid_comb_4x_W12#c.latent_decline_LAD 10.pid_comb_4x_W12#c.latent_decline_LAD) legend(off) scale(0.8)
      graph save decline_graph3_POLB_RR_alt, replace
	  	  	  graph export decline_graph3_POLB_RR.tif
	  
	  * APPENDIX
	  
	       * TABLE A1
   
esttab answers_demog_polit_T1_NEW decline_demog_polit_T2_NEW using decline_TA1_POLB_RR.rtf, replace mtitle("Answers both questions" "Perceived decline") label not b(%9.2f) ci wide  compress nocons nogaps drop(_cons 1.gender 1.minority 2.workStat_lab_mkt 1.homeowner_bin_W12 0.caringResponsibilitiesW6_W14 0.LAD_change_W10_W12) stats(N N_l2 sb_rsq_l1 sb_rsq_l2 aic bic) 
	  
* MODELS FOR REST OF APPENDIX

	   	                xtmixed declineScaleW12 ib0.ageCatW12_v2 i.gender ib2.workStat_lab_mkt i.homeowner_bin_W12 ///
  i.ghincomeW12 i.caringResponsibilitiesW6_W14 i.edlevelW12 i.minority  i.LAD_change_W10_W12 ///
  c.polAttentionpdlW12 infoScaleW12 ib0.econGenRetro_4xW11 c.changeImmigW11 ib0.econPersonalRetro_4xW11 i.euRefVoteRetroW12 ib0.pid_comb_4x_W12 ///
   c.incr_unemp_LAD c.unemp_LAD  || LAD17CD_W12:   if model_pop==1
   mltrsq
 eststo decline_demog_unemp

	                xtmixed declineScaleW12 ib0.ageCatW12_v2 i.gender ib2.workStat_lab_mkt i.homeowner_bin_W12 ///
  i.ghincomeW12 i.caringResponsibilitiesW6_W14 i.edlevelW12 i.minority  i.LAD_change_W10_W12 ///
  c.polAttentionpdlW12 infoScaleW12 ib0.econGenRetro_4xW11 c.changeImmigW11 ib0.econPersonalRetro_4xW11 i.euRefVoteRetroW12 ib0.pid_comb_4x_W12 ///
   c.incr_income_LAD c.ghdi_LAD  || LAD17CD_W12:   if model_pop==1
  mltrsq
   eststo decline_demog_ghdi

	                xtmixed declineScaleW12 ib0.ageCatW12_v2 i.gender ib2.workStat_lab_mkt i.homeowner_bin_W12 ///
  i.ghincomeW12 i.caringResponsibilitiesW6_W14 i.edlevelW12 i.minority  i.LAD_change_W10_W12 ///
  c.polAttentionpdlW12 infoScaleW12 ib0.econGenRetro_4xW11 c.changeImmigW11 ib0.econPersonalRetro_4xW11 i.euRefVoteRetroW12 ib0.pid_comb_4x_W12 ///
   c.incr_houseprice_LAD c.houseprice_LAD  || LAD17CD_W12:   if model_pop==1
  mltrsq
   eststo decline_demog_hp
   
   	                xtmixed declineScaleW12 ib0.ageCatW12_v2 i.gender ib2.workStat_lab_mkt i.homeowner_bin_W12 ///
  i.ghincomeW12 i.caringResponsibilitiesW6_W14 i.edlevelW12 i.minority  i.LAD_change_W10_W12 ///
  c.polAttentionpdlW12 infoScaleW12 ib0.econGenRetro_4xW11 c.changeImmigW11 ib0.econPersonalRetro_4xW11 i.euRefVoteRetroW12 ib0.pid_comb_4x_W12 ///
   ib0.pid_comb_4x_W12##c.incr_unemp_LAD c.unemp_LAD  || LAD17CD_W12:   if model_pop==1
     mltrsq
  eststo ddp_int_unemp

  	                xtmixed declineScaleW12 ib0.ageCatW12_v2 i.gender ib2.workStat_lab_mkt i.homeowner_bin_W12 ///
  i.ghincomeW12 i.caringResponsibilitiesW6_W14 i.edlevelW12 i.minority  i.LAD_change_W10_W12 ///
  c.polAttentionpdlW12 infoScaleW12 ib0.econGenRetro_4xW11 c.changeImmigW11 ib0.econPersonalRetro_4xW11 i.euRefVoteRetroW12 ib0.pid_comb_4x_W12 ///
   ib0.pid_comb_4x_W12##c.incr_income_LAD c.ghdi_LAD  || LAD17CD_W12:   if model_pop==1
     mltrsq
  eststo ddp_int_ghdi

  	                xtmixed declineScaleW12 ib0.ageCatW12_v2 i.gender ib2.workStat_lab_mkt i.homeowner_bin_W12 ///
  i.ghincomeW12 i.caringResponsibilitiesW6_W14 i.edlevelW12 i.minority  i.LAD_change_W10_W12 ///
  c.polAttentionpdlW12 infoScaleW12 ib0.econGenRetro_4xW11 c.changeImmigW11 ib0.econPersonalRetro_4xW11 i.euRefVoteRetroW12 ib0.pid_comb_4x_W12 ///
   ib0.pid_comb_4x_W12##c.incr_houseprice_LAD c.houseprice_LAD  || LAD17CD_W12:   if model_pop==1
     mltrsq
  eststo ddp_int_hp
  
   	                xtmixed declineScaleW12 ib0.ageCatW12_v2 i.gender ib2.workStat_lab_mkt i.homeowner_bin_W12 ///
  i.ghincomeW12 i.caringResponsibilitiesW6_W14 i.edlevelW12 i.minority  i.msoa_change_W10_W12 ///
  ib0.pid_comb_4x_W12 c.polAttentionpdlW12 infoScaleW12 ib0.econGenRetro_4xW11 c.changeImmigW11 ib0.econPersonalRetro_4xW11 i.euRefVoteRetroW12 ib0.pid_comb_4x_W12 ///
   c.latent_decline_MSOA c.latent_distress_MSOA  || msoa11W12:   if model_pop==1
    mltrsq
   eststo decline_demog_polit_TA4
   
	                xtmixed declineScaleW12 ib0.ageCatW12_v2 i.gender ib2.workStat_lab_mkt i.homeowner_bin_W12 ///
  i.ghincomeW12 i.caringResponsibilitiesW6_W14 i.edlevelW12 i.minority  i.msoa_change_W10_W12 ///
  c.polAttentionpdlW12 infoScaleW12 ib0.econGenRetro_4xW11 c.changeImmigW11 ib0.econPersonalRetro_4xW11 i.euRefVoteRetroW12 ib0.pid_comb_4x_W12 ///
   ib0.pid_comb_4x_W12##c.latent_decline_MSOA c.latent_distress_MSOA  || msoa11W12:   if model_pop==1
  mltrsq
   eststo decline_demog_polit_int_TA4
   
	
	* TABLE A2

	        esttab decline_demog_unemp decline_demog_ghdi decline_demog_hp using decline_POLB_TA2_RR.rtf, replace label not b(%9.2f) ci onecell compress nocons nogaps keep(incr_unemp_LAD unemp_2017_new incr_income_LAD ghdi_LAD incr_houseprice_LAD houseprice_LAD) stats(N N_l2 sb_rsq_l1 sb_rsq_l2 aic bic) 

* TABLE A3
  
     esttab ddp_int_unemp ddp_int_ghdi ddp_int_hp using decline_POLB_TA3_RR.rtf, replace label not b(%9.2f) ci onecell compress nocons nogaps keep(0.pid_comb_4x_W12 1.pid_comb_4x_W12 9.pid_comb_4x_W12 10.pid_comb_4x_W12 incr_unemp_LAD unemp_2017_new incr_income_LAD ghdi_LAD incr_houseprice_LAD houseprice_LAD 0.pid_comb_4x_W12#c.incr_unemp_LAD	0.pid_comb_4x_W12#c.incr_income_LAD 0.pid_comb_4x_W12#c.incr_houseprice_LAD  1.pid_comb_4x_W12#c.incr_unemp_LAD 1.pid_comb_4x_W12#c.incr_income_LAD 	1.pid_comb_4x_W12#c.incr_houseprice_LAD  9.pid_comb_4x_W12#c.incr_unemp_LAD	9.pid_comb_4x_W12#c.incr_income_LAD  9.pid_comb_4x_W12#c.incr_houseprice_LAD  10.pid_comb_4x_W12#c.incr_unemp_LAD 10.pid_comb_4x_W12#c.incr_income_LAD 	10.pid_comb_4x_W12#c.incr_houseprice_LAD) stats(N N_l2 sb_rsq_l1 sb_rsq_l2 aic bic) 


* TABLE A4

   esttab decline_demog_polit_TA4 decline_demog_polit_int_TA4 using decline__POLB_TA4_RR.rtf, replace label not b(%9.2f) ci wide compress nocons nogaps drop(_cons 1.gender 1.minority 2.workStat_lab_mkt 1.homeowner_bin_W12 0.caringResponsibilitiesW6_W14 0.msoa_change_W10_W12) stats(N N_l2 sb_rsq_l1 sb_rsq_l2 aic bic) 
   

* FIGURE A2

   
   	                melogit localEconNowYN_W12 ib0.ageCatW12_v2 i.gender i.edlevelW12 i.minority  i.caringResponsibilitiesW6_W14 i.LAD_change_W10_W12 ib2.workStat_lab_mkt  ///
  i.ghincomeW12 i.homeowner_bin_W12 ib0.econPersonalRetro_4xW11 ///
  ib0.pid_comb_4x_W12 i.euRefVoteRetroW12 ib0.econGenRetro_4xW11 c.changeImmigW11 c.polAttentionpdlW12 infoScaleW12 if _est_answers_model_pop==1 || LAD17CD_W12: 
  eststo answers_now
  
  	                melogit localEcon1520YN_W12 ib0.ageCatW12_v2 i.gender i.edlevelW12 i.minority  i.caringResponsibilitiesW6_W14 i.LAD_change_W10_W12 ib2.workStat_lab_mkt  ///
  i.ghincomeW12 i.homeowner_bin_W12 ib0.econPersonalRetro_4xW11 ///
  ib0.pid_comb_4x_W12 i.euRefVoteRetroW12 ib0.econGenRetro_4xW11 c.changeImmigW11 c.polAttentionpdlW12 infoScaleW12 if _est_answers_model_pop==1 || LAD17CD_W12: 
    eststo answers_past  
  
  coefplot answers_now answers_past, xline(0) mlabel(cond(@pval<.001, "***", cond(@pval<.01, "**", cond(@pval<.05, "*", "")))) baselevels drop(_cons 1.gender 1.minority 2.workStat_lab_mkt 1.homeowner_bin_W12 0.caringResponsibilitiesW6_W14 0.LAD_change_W10_W12) headings(0.ageCatW12_v2 = "{bf:Demographics}" 1.workStat_lab_mkt = "{bf:Economics}" 0.pid_comb_4x_W12 = "{bf:Politics}") legend(order(2 "Now" 4 "15-20 years ago")) scheme(s2mono) scale(0.55)  xsize(6.27) ysize(6.27)
	  graph save decline_graphA2_POLB, replace
	  	  graph export decline_graphA2_POLB.tif, replace